package com.mybatis.springboot_mybatis01.service.impl;

import com.mybatis.springboot_mybatis01.mapper.UserMapper;
import com.mybatis.springboot_mybatis01.pojo.User;
import com.mybatis.springboot_mybatis01.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;
    @Override
    public List<User> findAll() {
        return userMapper.findAll();
    }

    @Override
    public User getOne(Integer id) {
        return userMapper.getOne(id);
    }

    @Override
    public void insetUser(User user) {
        userMapper.insetUser(user);
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateUser(user);
    }

    @Override
    public void deleteUser(Integer id) {
        userMapper.deleteUser(id);
    }
}
